how to solve leetcode running sum of 1d array

visit shbcf.ru